<?php
class Macys_View_Helper_Category_V2Refinements extends Zend_View_Helper_Abstract {

	public $view;
	public $log;

	public function setView(Zend_View_Interface $view) {
		$this->view = $view;

	}

	public function category_V2Refinements() {


		$this->log = Zend_Registry::get('log');

		$cat = Macys_Api_V2_Catalog_Category::getInstance();
		$response = $cat->getResponse();
		if(empty($response)) {
			$pages = null;
		}
		else {
			$refinements = $cat->getResponse()->getRefinementsNavigation();
			if(empty($refinements)) {
				$pages = null;
			}
			else {
				$pages = $refinements;
			}
				
		}

		if(empty($pages)) {
				
			//array("label"=>"No Data Available");
			$a = new Zend_Navigation_Page_Mvc(array("label"=>"Refinements Not Available", "controller"=> "index", "action"=>"index"));
			$x = new Zend_Navigation(array($a));
		}
		else {
			$x = new Zend_Navigation($pages);
		}


		return $x;

	}
}